package Collection;

/*
    自定义单向链表
 */
public class SingleLinkList {
    public static void main(String[] args) {
        Node node1=new Node("a");
        node1.next=new Node("b");
        node1.next.next=new Node("c");
        System.out.println(node1);
    }
}
class Node{
    String data;
    Node next;
    public Node(String data){
        this.data=data;
    }

    @Override
    public String toString() {
        return this.next==null?data:data+this.next.toString();
    }
}
